import { getData, postData, deleteData, putData } from './axios'

// ? 获取路由列表的Api
export async function getRouterListApi(params?: any) {
  var res = await getData('/router/list', { ...params })
  return res
}

// ? 添加单个路由的Api
export async function addRouterApi(data: any) {
  var res = await postData('/router/add', data)
  return res
}

// ? 删除单个路由的Api
export async function deleteRouterApi(id: string) {
  var res = await deleteData('/router/delete', { id })
  return res
}

// ? 获取路由详细信息的Api
export async function findRouterApi(id: any) {
  var res = await getData('/router/find', { id })
  return res
}

// ? 修改单个路由信息的Api
export async function updateRouterApi(data: any) {
  var res = await putData('/router/update', data)
  return res
}

// ? 修改单个路由的侧边栏状态的Api
export async function updateRouterMeunStatusApi(id: string, hide: boolean) {
  var res = await putData('/router/changeAside', { id, hide })
  return res
}

// ? 获取菜单列表的Api
export async function getMenuListApi() {
  var res = await getData('/menu/list')
  return res
}
